package net.csdn.business.common.domain.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @author wanghang
 * @version 1.0
 * @date 2022/9/21 15:22
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserPaginatedRespVo implements Serializable {
    @JsonProperty("statusCode")
    private Integer statusCode;
    @JsonProperty("message")
    private String message;
    @JsonProperty("apiCode")
    private Integer apiCode;
    @JsonProperty("data")
    private UserPagingDto data;

    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class UserPagingDto {
        @JsonProperty("totalCount")
        private Integer totalCount;
        @JsonProperty("list")
        private List<UserDto> list;
    }

    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class UserDto {
        @JsonProperty("userId")
        private String userId;
        @JsonProperty("createdAt")
        private String createdAt;
        @JsonProperty("status")
        private String status;
        @JsonProperty("email")
        private String email;
        @JsonProperty("phone")
        private String phone;
        @JsonProperty("phoneCountryCode")
        private String phoneCountryCode;
        @JsonProperty("username")
        private String username;
        @JsonProperty("name")
        private String name;
        @JsonProperty("nickname")
        private String nickname;
        @JsonProperty("photo")
        private String photo;
        @JsonProperty("loginsCount")
        private Integer loginsCount;
        @JsonProperty("lastLogin")
        private String lastLogin;
        @JsonProperty("lastIp")
        private String lastIp;
        @JsonProperty("gender")
        private Gender gender;
        @JsonProperty("emailVerified")
        private Boolean emailVerified;
        @JsonProperty("phoneVerified")
        private Boolean phoneVerified;
        @JsonProperty("passwordLastSetAt")
        private String passwordLastSetAt;
        @JsonProperty("birthdate")
        private String birthdate;
        @JsonProperty("country")
        private String country;
        @JsonProperty("province")
        private String province;
        @JsonProperty("city")
        private String city;
        @JsonProperty("address")
        private String address;
        @JsonProperty("streetAddress")
        private String streetAddress;
        @JsonProperty("postalCode")
        private String postalCode;
        @JsonProperty("externalId")
        private String externalId;
        @JsonProperty("resetPasswordOnNextLogin")
        private Boolean resetPasswordOnNextLogin;
        @JsonProperty("departmentIds")
        private List<String> departmentIds;
        @JsonProperty("identities")
        private List<IdentityDto> identities;
        @JsonProperty("customData")
        private Object customData;

        private String profile;
        private String company;
        private String website;
        private String region;
        private String passwordSecurityLevel;
        private String userSourceType;
        private String userSourceId;
    }

    @Data
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public static class IdentityDto {
        @JsonProperty("identityId")
        private String identityId;
        @JsonProperty("extIdpId")
        private String extIdpId;
        @JsonProperty("provider")
        private String provider;
        @JsonProperty("type")
        private String type;
        @JsonProperty("userIdInIdp")
        private String userIdInIdp;

        private Object userInfoInIdp;
    }

    public static enum Gender {
        @JsonProperty("M")
        M("M"),
        @JsonProperty("W")
        W("W"),
        @JsonProperty("U")
        U("U");

        private String value;

        private Gender(String value) {
            this.value = value;
        }

        public String getValue() {
            return this.value;
        }
    }

    public static enum Status {
        @JsonProperty("Suspended")
        SUSPENDED("Suspended"),
        @JsonProperty("Resigned")
        RESIGNED("Resigned"),
        @JsonProperty("Activated")
        ACTIVATED("Activated"),
        @JsonProperty("Archived")
        ARCHIVED("Archived"),
        @JsonProperty("Deactivated")
        DEACTIVATED("Deactivated");

        private String value;

        private Status(String value) {
            this.value = value;
        }

        public String getValue() {
            return this.value;
        }
    }

}
